CreateSecurityGroup
Description
call CreateSecurityGroup to create a new security group. for a new security group, only instances in the security group are allowed to access each other by default, and all communication requests outside the security group are rejected. To allow communication requests from other security group instances or access requests from the Internet, you must grant security group permissions (AuthorizeSecurityGroup).
Request Method
POST
Request Path
/apsara/route/Ecs/CreateSecurityGroup
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
Description | BODY | string | No | SecurityGroupTestDescription | security group description information. The length is 2~256 English or Chinese characters, and cannot be http:// and https:// start. default value: empty. |
Tag.N.key | BODY | string | No | null | the tag key of the security group. Description To improve compatibility, we recommend that you use the Tag.N.Key parameter as much as possible. |
Tag.N.Key | BODY | string | No | Test | the tag key of the security group. The value range of n is 1~20. Once the value is passed in, an empty string is not allowed. Supports up to 128 characters, cannot start with aliyun and acs:, cannot contain http:// or https://. |
SecurityGroupName | BODY | string | No | SecurityGroupTestName | security group name. The length is 2~128 English or Chinese characters. Must start with a large or small letter or Chinese, and cannot be http:// and https:// start. It can contain numbers, colons (:), underscores (_), or dashes (-). Default value: empty. |
ResourceGroupId | BODY | string | No | rg-bp67acfmxazb4p**** | the ID of the enterprise resource group where the security group is located. |
SecurityGroupType | BODY | string | No | enterprise | security group type, divided into normal security group and enterprise security group. Value range: normal: normal security group. enterprise: enterprise security group. |
version | BODY | string | No | 2016-01-01 | version of api |
Tag.N.value | BODY | string | No | null | the tag value of the security group. description to improve compatibility, it is recommended that you try to use the Tag.N.Value parameter. |
VpcId | BODY | string | No | vpc-bp1opxu1zkhn00gzv**** | VPC ID to which the security group belongs. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
Tag.N.Value | BODY | string | No | Test | the tag value of the security group. The value range of n is 1~20. Once the value is passed in, an empty string is allowed. Supports up to 128 characters, cannot start with acs:, cannot contain http:// or https://. |
RegionId | BODY | string | Yes | cn-qingdao-env17-d01 | the region ID of the security group. You can call the DescribeRegions to view the latest Alibaba Cloud region list. |
ClientToken | BODY | string | No | 123e4567-e89b-12d3-a456-426655440000 | Ensure request idempotence. Generate a parameter value from your client to ensure that the parameter value is unique between different requests. ClientToken only supports ASCII characters and cannot exceed 64 characters. For more details, please refer to the section on how to ensure idempotence in the cloud server ECS development guide. |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}